<template>
	<view class="serve_item">
		<view class="serve_l">
			<image :src="goodsItem.product_info.preview_img"
				mode="widthFix"></image>
		</view>
		<view class="serve_r">
			<view class="sr_t">
				<view class="sr_title">
					{{goodsItem.product_info.product_name}}
				</view>
				<view class="">
					<text class="cred" style="text-align: right; font-size: 12px; font-weight: 700;">
						<!-- 实付 -->￥
						<text style="font-size: 14px;" class="money_now">{{goodsItem.sku_id>0?goodsItem.sku_price:goodsItem.mall_product_info.product_shop_price}}</text>
					</text>
						
				</view>
				
			</view>
			<view class="sr_m">
			
				<view style="font-size: 12px; color: #666;">
					{{goodsItem.sku_msg || ''}}
				</view>
				<view class="huaxian" style="font-weight: 500; font-size: 24rpx; color: #888;text-align: right;">￥ <text style="font-size: 14px;">{{goodsItem.market_price}}</text> </view>
			</view>
			<view class="sr_m">
				<view class="apm" v-if="memberLevel != 0">
					<!-- <text class="tag">会员折扣</text>	 -->
				</view>
				<view class="goods-num">
					X{{goodsItem.buy_num}}
				</view>
			</view>
			<view class="sr_b">
				<view class="" style="font-size: 10px;">
					进口税(含运费税款):商品已含税
				</view>
				
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		name: "serveAdd",
		props:{
			goodsItem:{
				type:Object
			},
			isOrder:{
				type:Boolean,
				default:false
			},
			isDetail:{
				type:Boolean,
				default:false
			}
		},
		created() {
			console.log('子组件触发')
			console.log(this.goodsItem)
			this.memberLevel = uni.getStorageSync('memberLevel');
		},
		data() {
			return {
				 num:0,
				 memberLevel:''
			}
		},
		methods: {
		
			toDetail() {

			}
		}
	}
</script>

<style lang="scss" scoped>
	$myfont-color:#292929;

	.cred {
		color: #f55535;
	}

	@mixin ellipsis {
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}

	.serve_item {
		display: flex;
		border-radius: 10px;
		background-color: #fff;
		padding: 24rpx;
		margin-bottom: 12px;

		.serve_l {
			width: 105px;
			height: 86px;
			overflow: hidden;
			border-radius: 5px;

			image {
				height: 100%;
				width: 100%;
			}
		}

		.serve_r {
			padding-left: 10px;
			flex: 1;
			max-width: 235px;

			.sr_t {
				display: flex;
				// align-items: center;

				.sr_title {
					font-size: 12px;
					color: $myfont-color;
					flex: 1;
				}

			}

			.sr_m {
				display: flex;
				margin-bottom: 8px;
				font-size: 12px;
				color: #666;
				align-items: center;
				justify-content: space-between;
				.sr_xl {
					font-size: 10px;
					color: #999;
					margin-left: 12px;

					.xl_num {
						color: #e2ab09;
					}
				}

				.apm {
					font-size: 12px;
					.tag{
						padding: 2px 4px;
						color: red;
						background-color: #FFE4E4;
						border-radius: 8px;
					}
				}

				.clock {
					// margin-left: 12px;
				}
			}

			.sr_b {
				display: flex;
				align-items: center;
				.goods-num{
					font-size: 12px;
					color: #999;
					margin-left: 12px;
				}
				.money_now {
					font-size: 18px;
					font-weight: 700;
				}

				.money_ago {
					font-size: 10px;
					text-decoration: line-through;
					color: #999;
					margin-left: 4px;
					margin-right: 8px;
				}
				.minus {
						width: 17px;
						height: 17px;
						border-width: 1px;
						border-color: #724ce6;
						border-style: solid;
						border-top-left-radius: 100px;
						border-top-right-radius: 100px;
						border-bottom-left-radius: 100px;
						border-bottom-right-radius: 100px;
						display: flex;
						justify-content: center;
						align-items: center;
						text-align: center;
					}
				
					.input {
						padding: 0 10px;
					}
				
					.plus {
						width: 17px;
						height: 17px;
						background-color: #724ce6;
						border-radius: 50%;
						/* #ifndef APP-NVUE */
						display: flex;
						/* #endif */
						justify-content: center;
						align-items: center;
						border: 1px solid #724ce6;
					}
			}
		}
	}
	
</style>
